//用户模块

import http from "../utils/request"


//获取验证码
export const getCaptcha = () => http.get("/users/getCaptcha?v=next")
// export let getCaptcha = () => http.get("/users/getCaptcha?v=next")


//检验验证码
export const verifyCaptcha = captcha => http.get("/users/verifyCaptcha",{
    params:{
        captcha
    }
})


//获取手机验证码
export const getSmsCode = phoneNumber => http.post("/sms/send",{phoneNumber})


//手机验证码登入
export const smsLogin = code => http.post("/users/login?type=sms",{code})


//常规登录
export const loginApi = (username,password) => http.post("/users/login",{username,password})


//登录日志
export const loginLog = (page,count) => http.get("/getloginlog",{page,count})


//获取二维码地址
export let getQrCodeApi = sid => http.get("/users/getQrcode",{
    params:{
        sid
    }
})


//微信登录
export let wechatLoginApi = wechatCode => http.get("/users/wechatLogin",{
    params:{
        wechatCode
    }
})


//获取所有用户接口
export const getAllUsersApi = () => http.get("/users/getAllUsers")




//获取学员信息
export const getStuListApi = (count = 10, page = 1, classes) => http.get("/students/getstulist",{
    params: {
        count,
        page,
        class: classes
    }
})

//增加学员信息
export const addStuApi = (data) => http.post("/students/addstu",{...data})

//修改编辑学员信息
export const editStuApi = data => http.post("/students/updatestu",{...data})

//删除学员信息
export const deleteStuApi = sId => http.get("/students/delstu",{
    params:{
        sId
    }
})

//搜索学员信息
export const searchStuApi = (key) => http.get("/students/searchstu",{
    params:{
        key
    }
})

//获取班级列表
export const getClassesApi = () => http.get("/students/getclasses")


